package cn.ycc1.mymcp.server.stdio;

import cn.ycc1.mymcp.server.stdio.service.OpenMeteoService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class MyMcpServerStdioApplication {

	public static void main(String[] args) {
		SpringApplication.run(MyMcpServerStdioApplication.class, args);
	}

	@Bean
	public ToolCallbackProvider weatherTools(OpenMeteoService openMeteoService) {
		return MethodToolCallbackProvider.builder()
				.toolObjects(openMeteoService)
				.build();
	}
}
